import React from 'react';
import Styles from '../index.module.scss';
import {withRouter} from 'react-router-dom';
import {connect} from 'react-redux'
class Search extends React.Component {
  state = {  }
  render() { 
    return ( 
      <>
        <div className={Styles.search_input}>
          <div className={Styles.search_input_le}>
            <div className={Styles.city_tab} onClick={()=>{
              // console.log(this.props);
              this.props.history.push('/cityselect')
            }}>
              <span className={Styles.city_name}>{this.props.cityName}</span>
              <i className={'iconfont icon-arrow '+ Styles.iconfont}></i>
            </div>
            <div className={Styles.input}>
              <span className={'iconfont icon-seach '+ Styles.iconfont}></span>
              <span className={Styles.placeholder}>请输入小区或地址</span>
            </div>
          </div>
          <div className={Styles.search_input_ri} onClick={()=>{this.props.history.push('/mapfound');
          }}>
            <span className={'iconfont icon-map '+ Styles.iconfont}></span>
          </div>
        </div>
      </>
     );
  }
}
 const mapStateToProps = (state) =>({
  cityName:state.address.city
 })
export default connect(mapStateToProps)(withRouter(Search));